<!DOCTYPE html>
<html ng-app="userApp" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" th:href="@{/assets/select-mutiple/css/select-multiple.css}"/>
    <header th:replace="importCommon"></header>
    <script th:src="@{/js/system/controller/UserCtrl.js}"></script>
    <script th:src="@{/js/system/service/UserService.js}"></script>
    <script th:src="@{/assets/select-mutiple/js/multiselect.min.js}"></script>
    <script th:src="@{/assets/select-mutiple/js/prettify.min.js}"></script>
    <title>用户管理</title>
</head>
<body ng-controller="userCtrl">
<div class="page-content">
    <div class="commonManager">
        <form id="form1" name="form1" method="post" action="">
            <div class="Manager_style add_user_info search_style">
                <ul class="search_content clearfix" shiro:hasPermission="/user/list">
                    <li><label class="lf">帐号</label>
                        <label>
                            <input name="username" ng-model="queryFilter.param.username" type="text"
                                   class="text_add"/>
                        </label>
                    </li>
                    <li><label class="lf">姓名</label>
                        <label>
                            <input name="realName" ng-model="queryFilter.param.realName"
                                   type="text"
                                   class="text_add"/>
                        </label>
                    </li>
                    <li><label class="lf">手机号码</label>
                        <label>
                            <input name="mobile" ng-model="queryFilter.param.mobile" type="text"
                                   class="text_add"/>
                        </label>
                    </li>
                </ul>
                <ul class="search_content clearfix">
                    <button id="btn_search" ng-click="userSearch = !userSearch" type="button"
                            class="btn btn-primary queryBtn">查询
                    </button>
                    <button class="btn btn-primary addBtn" type="button" ng-click="updateUser(0)"
                            id="Add_user_btn" shiro:hasPermission="/user/add">添加
                    </button>
                    <button type="button" class="btn btn-primary updateBtn" ng-click="updateUser(1)"
                            shiro:hasPermission="/user/edit">修改
                    </button>
                    <button type="button" class="btn btn-primary deleteBtn" ng-click="deleteUser()"
                            shiro:hasPermission="/user/delete">删除
                    </button>
                    <button type="button" class="btn btn-primary resetBtn" ng-click="resetPwd()"
                            shiro:hasPermission="/user/resetPwd">重置密码
                    </button>
                    <button type="button" class="btn btn-primary assignBtn" ng-click="assignRole()"
                            shiro:hasPermission="/user/addRoles">角色分配
                    </button>
                </ul>
                <div id="Add_user_style" style="display: none">
                    <div class="addCommon clearfix">
                        <ul class="clearfix">
                            <li>
                                <label class="label_name">用户名</label>
                                <label for="name"></label>
                                <input name="username" ng-model="user.username" type="text" id="name"/>
                                <i style="color: #F60;">*</i>
                            </li>
                            <!--<li>
                                <label class="label_name">密码</label>
                                <label for="password"></label>
                                <input name="password" ng-model="user.password" type="password"
                                       id="password"/>
                                <i style="color: #F60;">*</i>
                            </li>-->
                            <li>
                                <label class="label_name">手机号</label>
                                <label for="phone"></label>
                                <input name="mobile" ng-model="user.mobile" type="text" id="phone"/>
                            </li>
                            <li>
                                <label class="label_name">邮箱</label>
                                <label for="email"></label>
                                <input name="email" ng-model="user.email" type="text" id="email"/>
                            </li>
                            <li>
                                <label class="label_name">真实姓名</label>
                                <label for="user_name"></label>
                                <input name="realName" ng-model="user.realName" type="text"
                                       id="user_name"/>
                            </li>
                            <li>
                                <label class="label_name">状态</label>
                                <label>
                                    <select name="locked" size="1" ng-model="user.locked"
                                            ng-init="user.locked=0">
                                        <option ng-repeat="map in lockedMap"
                                                ng-selected="map.locked == user.locked"
                                                value="{{map.locked}}" ng-bind="map.name"></option>
                                    </select>
                                </label>
                                <i style="color: #F60;">*</i>
                            </li>
                            <li style="width:524px;position:relative;right:14px;">
                                <label class="label_name">备注</label>
                                <textarea name="remark" ng-model="user.remark" type="text" style="width:443px;"
                                          id="remark" rows="4" cols="25">
                                </textarea>
                            </li>
                        </ul>
                    </div>
                </div>

                <div id="assignRole" style="height:100%;display: none;">
                    <div class="col-xs-5" style="height: 100%;">
                        <select name="from[]" id="multiselect" style="height: 100%;" class="form-control" size="8"
                                multiple="multiple">
                            <option style="text-align:center;" ng-repeat="map in roleMap" value="{{map.roleId}}"
                                    ng-bind="map.name"></option>
                        </select>
                    </div>

                    <div class="col-xs-2" style="margin: 20% 0;">
                        <button type="button" id="multiselect_rightAll" class="btn btn-block"><i
                                class="glyphicon glyphicon-forward"></i></button>
                        <button type="button" id="multiselect_rightSelected" class="btn btn-block"><i
                                class="glyphicon glyphicon-chevron-right"></i></button>
                        <button type="button" id="multiselect_leftSelected" class="btn btn-block"><i
                                class="glyphicon glyphicon-chevron-left"></i></button>
                        <button type="button" id="multiselect_leftAll" class="btn btn-block"><i
                                class="glyphicon glyphicon-backward"></i></button>
                    </div>

                    <div class="col-xs-5" style="height: 100%;">
                        <select name="to[]" style="height: 100%;" id="multiselect_to" class="form-control" size="8"
                                multiple="multiple">
                            <option style="text-align:center;" ng-repeat="role in includeRoleMap"
                                    value="{{role.roleId}}" ng-bind="role.name"></option>
                        </select>
                    </div>
                </div>

            </div>
        </form>
        <div class="Manager_style">
            <div class="User_list">
                <table id="User_list" cellpadding="0" cellspacing="0"
                       class="table table-striped table-bordered table-hover">
                    <thead>
                    <tr>
                        <th th:width="50">
                            <input name="userCheckBox_All" id="userCheckBox_All" type="checkbox"
                                   ng-click="selectAll($event)" class="ace"/>
                            <span class="lbl" style="cursor:pointer;"></span>
                        </th>
                        <th>帐号</th>
                        <th>姓名</th>
                        <th>状态</th>
                        <th>手机号</th>
                        <th>创建日期</th>
                        <th>更新日期</th>
                        <th>登录时间</th>
                        <th>操作IP</th>
                        <th>备注</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="model in data">
                        <td class="text-center">
                            <input name="subUserChkBox_{{$index}}" value="{{model.no}}" type="checkbox"
                                   class="ace subUserChkbox"/>
                            <span class="lbl" style="cursor:pointer;"></span>
                        </td>
                        <td ng-bind="model.username"></td>
                        <td ng-bind="model.realName"></td>
                        <td ng-bind="model.locked == '1' ?'停用':'启用'"></td>
                        <td ng-bind="model.mobile"></td>
                        <td ng-bind="model.createAt | date:'yyyy-MM-dd'"></td>
                        <td ng-bind="model.updateAt | date:'yyyy-MM-dd'"></td>
                        <td ng-bind="model.loginAt | date:'yyyy-MM-dd'"></td>
                        <td ng-bind="model.loginIp | date:'yyyy-MM-dd'"></td>
                        <td ng-bind="model.remark"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="hupan_more eg-page" url="/user/list" request-page-params="queryFilter"
                 click-search="userSearch" return-page-rows="data"></div>
        </div>
    </div>
</div>
</body>
</html>